package cs236369.hw5;

public class User {
	public User(String username, String password, String firstname, String lastname,
			String email, String phone, boolean isAdmin) throws RescueMeException {
		if (username==null || password==null) {
			throw new RescueMeException("nullParam", "A user construction failure because" +
					" a basic parameter is null");
		}
		this.username = username;
		this.password = password;
		this.firstname = firstname == null ? "" : firstname;
		this.lastname = lastname == null ? "" : lastname;
		this.email = email == null ? "" : email;
		this.phone = phone == null ? "" : phone;
		this.isAdmin = isAdmin;
	}
	
	public String getUserName() { return username; }
	public String getPassword() { return password; }
	public String getFirstName() { return firstname; }
	public String getLastName() { return lastname; }
	public String getEmail() { return email; }
	public String getPhone() { return phone; }
	public boolean isAdmin() { return isAdmin; }
	
	private String username, password, firstname, lastname, email, phone;
	private boolean isAdmin;
}
